﻿using System;
using System.Configuration;
using System.Web;

namespace TBM.Core
{
    public class Config
    {
        /// <summary>
        /// 字符串连接
        /// </summary>
        public static string ConnectionString = ConfigurationManager.ConnectionStrings["TBMDB"].ConnectionString;
        /// <summary>
        /// 分页大小
        /// </summary>
        public static int PageSize = Convert.ToInt32(ConfigurationManager.AppSettings["PageSize"]);
        /// <summary>
        /// 显示分页数
        /// </summary>
        public static int DisplayPageCount = Convert.ToInt32(ConfigurationManager.AppSettings["DisplayPageCount"]);
        /// <summary>
        /// 上传文件位置
        /// </summary>
        public static string FileDirectory = ConfigurationManager.AppSettings["FileDirectory"].TrimEnd(new char[] { '/', '\\' }) + "/";
        /// <summary>
        /// SMTP地址
        /// </summary>
        public static string SMTPAddress = ConfigurationManager.AppSettings["SMTP"];
        /// <summary>
        /// SMTP用户名
        /// </summary>
        public static string SMTPUserName = ConfigurationManager.AppSettings["SMTPUserName"];
        /// <summary>
        /// SMTP密码
        /// </summary>
        public static string SMTPPassword = ConfigurationManager.AppSettings["SMTPPassword"];
        /// <summary>
        /// SMTP发件箱地址
        /// </summary>
        public static string SMTPEmailAddress = ConfigurationManager.AppSettings["SMTPEmailAddress"];
        /// <summary>
        /// SMTP发件人显示名称
        /// </summary>
        public static string SMTPDisplayName = ConfigurationManager.AppSettings["SMTPDisplayName"];
        /// <summary>
        /// 站点名
        /// </summary>
        public static string SiteName = ConfigurationManager.AppSettings["SiteName"];
        /// <summary>
        /// 版权信息
        /// </summary>
        public static string CopyRight = ConfigurationManager.AppSettings["CopyRight"];
        /// <summary>
        /// 默认用户头像
        /// </summary>
        public static string DefaultPic = ConfigurationManager.AppSettings["DefaultPic"] != null ? VirtualPathUtility.ToAbsolute(ConfigurationManager.AppSettings["DefaultPic"]) : "";
    }
}